package biz

import (
	"context"
	"log"
)

type Cart struct {
}

type CartRepo interface {
	CreateCart(ctx context.Context, cart *Cart) error
	UpdateCart(ctx context.Context, cart *Cart) error
}

// CartUseCase 领域对象
type CartUseCase struct {
	repo CartRepo
	log  *log.Logger
}

func NewCartUseCase(repo CartRepo, logger *log.Logger) *CartUseCase {
	return &CartUseCase{
		repo: repo,
		log:  logger,
	}
}

func (cu *CartUseCase) Create(ctx context.Context, cart *Cart) error {
	return cu.repo.CreateCart(ctx, cart)
}

func (cu *CartUseCase) Update(ctx context.Context, cart *Cart) error {
	return cu.repo.UpdateCart(ctx, cart)
}
